<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/6
 * Time: 20:55
 */


require_once "../config/config.php";
require_once "../model/adminDb.php";
$adminDb = new adminDb();
$user_id=$_POST["user_id"];
$content=$_POST['content'];
$bug_id=$_POST['bug_id'];
$series=$_POST['series'];
$addtime = time();
$addData = $adminDb->add_comment($user_id,$bug_id,$series,$content,$addtime);

try {

    if ($addData) {
        $dat = array(
            'message' => "评论成功",
            "code" => 200,

        );
        echo json_encode($dat);
    } else {
        $dat = array(
            "code" => 404,
            'message' => "评论失败",

        );
        echo json_encode($dat);

    }
} catch (Exception $e) {

    // 回滚事务
    // $pdo->rollback();
    echo $e->getMessage();
}













